{extend name="index_layout"/}
{block name="main"}
<div class="top-container">
    <div class="top-main">
        <div class="layui-row layui-col-space20">
            <div class="layui-col-sm4 layui-col-md3 layui-col-lg3">
                <div class="layui-card">
                    <div class="layui-card-header">个人资料</div>
                    <div class="layui-card-body">
                        <div class="admin-info">
                            <div class="photo">
                                <img class="layui-upload-img" id="addPic">
                            </div>
                            <h3 class="layui-user">{$info.email}</h3>
                            <p class="login-time">上次登录：{$info.update_time}</p>
                        </div>
                        <form class="layui-form layui-form-pane" lay-filter="form">

                            <div class="layui-form-item">
                                <label class="layui-form-label">{:lang('username')}</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="username" lay-verify="required" placeholder="{:lang('pleaseEnter')}登录用户名" class="layui-input layui-disabled"  readonly="readonly">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    用户名在4到25个字符之间。
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">{:lang('password')}</label>
                                <div class="layui-input-inline">
                                    <input type="password" name="password" placeholder="{:lang('pleaseEnter')}登录密码" autocomplete="true" {if !empty($info)} lay-verify="required"{/if} class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    密码必须大于6位，小于15位。
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">头像</label>
                                <input type="hidden" name="avatar" id="avatar">
                                <div class="layui-input-inline">
                                    <div class="layui-upload">
                                        <button type="button" class="layui-btn layui-btn-primary" data-path="avatar" id="uploads"><i class="icon icon-upload3"></i>{:lang('upload')}</button>
                                    </div>

                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">{:lang('email')}</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="email" lay-verify="email" placeholder="{:lang('pleaseEnter')}用户邮箱" class="layui-input">
                                </div>
                                <div class="layui-form-mid layui-word-aux">
                                    用于密码找回，请认真填写。
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">{:lang('mobile')}</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="mobile" lay-verify="phone" value="" placeholder="{:lang('pleaseEnter')}手机号" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item layui-layer-footer">
                                <div>
                                    <input type="hidden" name="id"  >
                                    <button type="button" class="layui-btn" lay-submit="" lay-filter="submit"><i class="layui-icon layui-icon-form"></i> {:lang('submit')}</button>
                                    <button type="reset" class="layui-btn layui-btn-primary"> <i class="layui-icon layui-icon-delete"></i>{:lang('reset')}</button>
                                </div>
                            </div>

                        </form>
                    </div>
                </div>
            </div>
            <div class="layui-col-sm8 layui-col-md9 layui-col-lg9">
                <div class="layui-card">
                    <div class="layui-card-header">操作日志</div>
                    <div class="layui-card-body">
                        <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
                    </div>
                    <script type="text/html" id="action">
                        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" data-href="{:url('delete')}"><i class="layui-icon layui-icon-delete"></i></a>
                    </script>
                    <script type="text/html" id="create_time">
                        {{layui.util.toDateString(d.create_time*1000, 'yyyy-MM-dd HH:mm:ss')}}
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
    layui.use(['Admin','yznTable','laydate'], function() {
        var table = layui.yznTable,
            form = layui.form,
            laydate=layui.laydate,
            $=layui.$;
        var info = '';
        //日期范围
        laydate.render({
            elem: '#date'
            ,range: true
        });

        info = {:json_encode($info)};
        form.val("form", info);
        if(info){
            $('#addPic').attr('src',info.avatar);
        }
        form.render();


        table.render({
            id: 'currentTable',
            elem: '#currentTable',
            toolbar: ['refresh'],
            url: '{:url("system.log/mylog")}',
            cols: [
                [
                    {checkbox: true, fixed: 'left'},
                    {field: 'id', title: 'ID', width: 80, sort: true},
                    {field: 'admin_id', title: '管理ID', width: 100, sort: true},
                    {field: 'username', title: '账号', width: 100, sort: true},
                    {field: 'log_url', title: '地址', width: 250, templet: '#size', sort: true,},
                    {field: 'log_content', title: '内容', sort: true,},
                    {field: 'log_title', title: '标题', width: 120, sort: true,},
                    {field: 'log_ip', title: 'ip', width: 130},
                    {field: 'create_time', title: '时间', width: 180,templet:'#create_time'},
                    {title:'操作',width:100, toolbar: '#action',align:"center"}]
            ],
            page: {}
        });
    });
</script>
{/block}